extends CenterContainer

var data = null

var music_area_id = null


func _ready():
	pass 



func set_data(data):
	self.data = data


func set_music_area_id(music_area_id):
	self.music_area_id = music_area_id
	
	var edit_data = DataSource.get_data_by_one(DataSource.map_area, music_area_id)
	
	if edit_data:
		$PanelContainer/VBoxContainer/Label.text = "【%s】%s" % [edit_data["id"], edit_data["mapName"]]
	else:
		$PanelContainer/VBoxContainer/Label.text = "【%s】" % music_area_id

func _on_cancel_button_up():
	MainTool.getUILayer().pop_ui()


func _on_areaInfo_button_up():
	MainTool.getUILayer().pop_ui()
	var ui = MainTool.getUILayer().add_ui("res://tool/page/map/mapView/audioArea/modal/MapAreaMdoal.tscn")
	ui.set_music_area_id(music_area_id)


func _on_sprite_button_up():
	MainTool.getUILayer().pop_ui()
	var ui = MainTool.getUILayer().add_ui("res://tool/page/map/mapView/audioArea/modal/SpriteAreaModal.tscn")
	ui.set_music_area_id(music_area_id)
